package cn.iocoder.yudao.module.moa.dal.mysql.ccapply;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.moa.dal.dataobject.ccapply.CcApplyDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.moa.controller.admin.ccapply.vo.*;

/**
 * 出差申请 Mapper
 *
 * @author 管理员
 */
@Mapper
public interface CcApplyMapper extends BaseMapperX<CcApplyDO> {

    default PageResult<CcApplyDO> selectPage(CcApplyPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<CcApplyDO>()
                .eqIfPresent(CcApplyDO::getProjectId, reqVO.getProjectId())
                .eqIfPresent(CcApplyDO::getClueId, reqVO.getClueId())
                .eqIfPresent(CcApplyDO::getBusinessId, reqVO.getBusinessId())
                .eqIfPresent(CcApplyDO::getOwnerUserId, reqVO.getOwnerUserId())
                .eqIfPresent(CcApplyDO::getProcessInstanceId, reqVO.getProcessInstanceId())
                .eqIfPresent(CcApplyDO::getAuditStatus, reqVO.getAuditStatus())
                .betweenIfPresent(CcApplyDO::getStartTime, reqVO.getStartTime())
                .betweenIfPresent(CcApplyDO::getEndTime, reqVO.getEndTime())
                .eqIfPresent(CcApplyDO::getCczj, reqVO.getCczj())
                .eqIfPresent(CcApplyDO::getCcsm, reqVO.getCcsm())
                .eqIfPresent(CcApplyDO::getCfd, reqVO.getCfd())
                .eqIfPresent(CcApplyDO::getDdd, reqVO.getDdd())
                .eqIfPresent(CcApplyDO::getRemark, reqVO.getRemark())
                .betweenIfPresent(CcApplyDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(CcApplyDO::getId));
    }

}